home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Toolbox / ModalList / ModalListInit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-18  |  1.9 KB  |  77 lines  |  [TEXT/MPS ]

  1. /*
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    ModalList : Simple Modal Dialog and List Manager Sample Application
  6. #
  7. #    ModalListInit.c - Initialization Segment
  8. #
  9. #    Copyright © 1989 Apple Computer, Inc.
  10. #    All rights reserved.
  11. #
  12. #    Versions:    
  13. #            1.00                     10/89
  14. #            1.01                    06/92
  15. #
  16. #    Components:
  17. #            ModalList.make            October 1, 1989
  18. #            ModalList.h                October 1, 1989
  19. #            ModalList.c                October 1, 1989
  20. #            ModalListInit.c            June 12, 1992
  21. #            ModalList.r                October 1, 1989
  22. #            TCModalList.π            June 12, 1992
  23. #            TCModalList.π.rsrc        June 12, 1992
  24. #
  25. #    ModalList is an example application that demonstrates
  26. #    how to use the Dialog Manager and List Manager routines
  27. #    together. It is not a good example of a sample application
  28. #    but a great example of the use of lists in a dialog. The
  29. #    default LDEF is used to display a 2 dimensional list of strings.
  30. #    Each cell's string is initialized to represent it's position in the
  31. #    list. The user can change these strings and search for a particular
  32. #    setting. Once again this is not meant as an example application and
  33. #    there are some features that are documented in the source listing
  34. #    that you should pay close attention to inorder to understand how
  35. #    this example works.
  36. #
  37. */
  38.  
  39. #pragma segment Initialize
  40.  
  41. #include <QuickDraw.h>
  42. #include <Fonts.h>
  43. #include <Dialogs.h>
  44. #include <Windows.h>
  45. #include <TextEdit.h>
  46. #include <Memory.h>
  47. #include <OSUtils.h>
  48. #include <Packages.h>
  49. #include <SegLoad.h>
  50. #include "ModalList.h"
  51.  
  52.  
  53. void Initialize(void)
  54. {
  55.     auto    EventRecord event;
  56.     auto    short        count;
  57.     auto    SysEnvRec    mac;
  58.     
  59.     InitGraf((Ptr) &qd.thePort);
  60.     InitFonts();
  61.     InitWindows();
  62.     TEInit();
  63.     InitDialogs(nil);
  64.     InitCursor();
  65.     
  66.     for (count = 1; count <= 3; count++)
  67.         EventAvail(everyEvent, &event);
  68.     
  69.     /* Make sure that the machine has at least 128K ROMs which includes the List Manager.
  70.     ** If it doesn't, exit.
  71.     */
  72.     SysEnvirons(cSysEnvironsVersion, &mac);
  73.     if (mac.machineType < 0)
  74.         ExitToShell();
  75. }
  76.  
  77.